package com.timeriver.component;

import com.timeriver.domain.KVPair;
import com.timeriver.domain.PredictRequest;
import org.apache.dubbo.common.serialize.support.SerializationOptimizer;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

/**
 * 将需要序列化的模型类注册到Dubbo中
 */
@Component
public class SerializationOptimizerImpl implements SerializationOptimizer {
    @Override
    public Collection<Class> getSerializableClasses() {
        List<Class> classes = new LinkedList<Class>();
        classes.add(PredictRequest.class);
        classes.add(KVPair.class);
        classes.add(Double.class);
        return classes;
    }
}
